{%extends "MssaeSeoBundle::layout.html.twig"%}
{%block javascript%}
    {%javascripts
        '@MssaeSeoBundle/Resources/public/js/*'
        '@MssaeSeoBundle/Resources/public/js/jquery-1.7.2.min.js'
        '@MssaeSeoBundle/Resources/public/js/ProjetAnnuaire/ProjetAnnuaire.js'
        '@MssaeSeoBundle/Resources/public/js/jPages.min.js'
    %}
        <script src="{{asset_url}}"></script>
    {%endjavascripts%} 
{%endblock%}
 
{%block body%}
{% if is_granted("IS_AUTHENTICATED_REMEMBERED") %}
    <h1>Modification de l'inscription de {{entity.projet.nom}}</h1>
    {%block seo%}
    <div id="seo">
        {% include "MssaeSeoBundle:ProjetAnnuaire:annuaireForEditTemplate.html.twig"%} 

        {%block formulaire%}    
            <form action="{{ path('projetannuaire_update', { 'id': entity.id, 'idProject' : idProject }) }}" method="post" {{ form_enctype(edit_form) }}>
                {{ form_widget(edit_form) }}
                <input id = "idAnnuaire" name="idAnnuaire" type="hidden" value="{{entity.annuaire.id}}"/>                                    
                <p>
                    <button type="submit">Edit</button>
                </p>
            </form>
        {%endblock formulaire%}
        </div>
    {%endblock seo%}    
    <ul class="record_actions">
        <li>
            <a href="{{ path('projetannuaire', {'idProject' : idProject }) }}">
                Back to the list
            </a>
        </li>
    {%if is_granted('ROLE_ADMIN')%}          
        <li>   
            <form action="{{ path('projetannuaire_delete', { 'id': entity.id, 'idProject' : idProject }) }}" method="post">
                {{ form_widget(delete_form) }}
                <button type="submit">Delete</button>
            </form>
        </li>
    {%endif%}           
    </ul> 
{%else%}
    <div id ="error">
        Vous n'avez pas les droits néccessaires pour cette action
    </div>
{%endif%}    
{%endblock%}